﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://wubiyu.cnblogs.com">
<head>
      <title></title>
      <link href="../../Theme/DomExtGray/gray.min.css" rel="Stylesheet" type="text/css" />
      <link href="PageModel.css" rel="Stylesheet" type="text/css" />
      <script type="text/javascript" src="../../domExt.js"></script>
      <style type="text/css">

 p.MsoNormal
	{margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:"Calibri","sans-serif";
	              margin-left: 0cm;
                  margin-right: 0cm;
                  margin-top: 0cm;
            }
      </style>
</head>
<body>
      <div class="fun_title">
             &lt;h:text&gt;&lt;/h:text&gt;标记
      </div>
      <div class="fun_content">
            描述：文本框。<br />
      </div>
      <div class="fun_title2">
            标签属性:
      </div>
      <div class="fun_content2">
           isreadonly：设置或获取是否是指读状态<br />
           istextarea：设置或获取是否是 textarea。<br />
           maxchar：设置或获取最大输入字符。<br />
           ispsd：设置是否是密码文本框，默认为："false"<br />
           text：设置文本框初始值<br />
      </div>
       <div class="fun_title2">
           对象属性:
      </div>
       <div class="fun_content2">
           KeyUpHandle=function([对象自已], [文本内容长度]){};：当text 属性发生变化时触发的事件句柄。<br />
           txt：文本框的input Html对象<br />
       </div>
       <div class="fun_title2">
            对象方法:
      </div>
      <div class="fun_content2">
            <span>SetHeight(height)</span> ：设置文本框的高度。<br />
           <span>GetHeight()</span> ：获取文本框的高度。<br />
           <span>SetWidth(width)</span> ：设置文本框的宽度。<br />
           <span>GetWidth()</span> ：获取文本框的宽度。<br />
            <span>SetText(value)</span> ：设置文本框的值。<br />
           <span>GetText()</span> ：获取文本框的值。<br />
         
      </div>
      <div class="fun_title2">
            静态方法:
      </div>
       <div class="fun_content2">
          <span>_h.Text.GetText(textobj)</span> ：获取文本内容。<br />
          <span>_h.Text.SetText(textobj)</span> ：设置获取文本内容。<br />
          <span>_h.Text.AddEvent(e, eventname, fn)</span> ：为文本框添加事件。<br />
          <span>_h.Text.DeleteEvent(e, eventname, fn)</span> ：为文本框添加移除事件。<br />
      </div>
      <div class="fun_title2">
            示例预览:
      </div>
      <div class="code">
            <h:text text="文本框"></h:text>&nbsp;<h:text text="isreadonly" isreadonly="true">&nbsp;</h:text> <h:text text="maxchar 13" maxchar="13"></h:text>
            <h:text text="maxchar 13" maxchar="13" ispsd="true"></h:text><br /><br />
            <h:text id="textarea" text="多行文本框" istextarea="true" maxchar="100"></h:text>
            <div id="msg">0/100</div>
            <h:btn onclick="GetTextareaContent();">获取多行文本内容</h:btn>
            <script type="text/javascript">
                  _h.Page.OnLoadHandle = function () {
                        var textarea = _g("#textarea");
                        textarea.SetHeight(120);
                        textarea.SetWidth(470);
                        textarea.KeyUpHandle = function (e, lenght) {
                              _g("#msg").html(lenght + "/" + textarea.maxchar);
                        };
                  };
                  function GetTextareaContent() {
                        var textarea = _g("#textarea");
                        alert(textarea.GetText(textarea));
                  }
            </script>
        </div>
         <br />
       <div class="fun_title2">
            示例代码:
      </div>
       <div class="code">
             Html code<br />
             <p align="left" class="MsoNormal">
                   <span style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt"><span lang="EN-US" 
                         style="color:blue">&lt;</span><span lang="EN-US" style="color:fuchsia">h</span><span 
                         lang="EN-US" style="color:blue">:</span><span lang="EN-US" 
                         style="color:fuchsia">text</span><span lang="EN-US">
                   <span style="color:red">Text</span><span style="color:blue">=&quot;</span></span></span><span style="font-size:9.5pt;font-family:宋体;mso-ascii-font-family:&quot;Microsoft YaHei&quot;;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;color:blue;mso-font-kerning:
0pt">文本框</span><span lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;;color:blue;mso-font-kerning:0pt">¨°&quot;&gt;&lt;/</span><span 
                         lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;;color:fuchsia;mso-font-kerning:0pt">h</span><span lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;
color:blue;mso-font-kerning:0pt">:</span><span lang="EN-US" style="font-size:
9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;
color:#404040;mso-font-kerning:0pt">text</span><span lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;
color:blue;mso-font-kerning:0pt">&gt;</span><span lang="EN-US" style="font-size:
9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;
color:red;mso-font-kerning:0pt">&amp;nbsp;</span><span lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;
color:blue;mso-font-kerning:0pt">&lt;</span><span lang="EN-US" style="font-size:
9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;
color:fuchsia;mso-font-kerning:0pt">h</span><span lang="EN-US" style="font-size:
9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;
color:blue;mso-font-kerning:0pt">:</span><span lang="EN-US" style="font-size:
9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;
color:#404040;mso-font-kerning:0pt">text</span><span lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;
mso-font-kerning:0pt"> <span style="color:red">Text</span><span style="color:blue">=&quot;isreadonly&quot;</span>
                   <span style="color:red">isreadonly</span><span style="color:blue">=&quot;true&quot;&gt;</span><span 
                         style="color:red">&amp;nbsp;</span><span style="color:blue">&lt;/</span><span 
                         style="color:fuchsia">h</span><span style="color:blue">:</span><span 
                         style="color:#404040">text</span><span style="color:blue">&gt;</span>
                   <span style="color:blue">&lt;</span><span style="color:fuchsia">h</span><span 
                         style="color:blue">:</span><span style="color:#404040">text</span>
                   <span style="color:red">Text</span><span style="color:blue">=&quot;maxchar 13&quot;</span>
                   <span style="color:red">maxchar</span><span style="color:blue">=&quot;13&quot;&gt;&lt;/</span><span 
                         style="color:fuchsia">h</span><span style="color:blue">:</span><span 
                         style="color:#404040">text</span><span style="color:blue">&gt;</span><o:p><span lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;
mso-font-kerning:0pt"><span style="color:blue">&lt;</span><span style="color:fuchsia">h</span><span 
                         style="color:blue">:</span><span style="color:#404040">text</span>
                   <span style="color:red">Text</span><span style="color:blue">=&quot;maxchar 13&quot;</span>
                   <span style="color:red">maxchar</span><span style="color:blue">=&quot;13&quot; 
                   ispsd=&quot;true&quot;&gt;&lt;/</span><span 
                         style="color:fuchsia">h</span><span style="color:blue">:</span><span 
                         style="color:#404040">text</span><span style="color:blue">&gt;</span></span></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;color:blue;mso-font-kerning:
0pt">&lt;</span><span lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;;color:maroon;mso-font-kerning:0pt">br</span><span 
                         lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt"> <span style="color:blue">/&gt;&lt;</span><span 
                         style="color:maroon">br</span> <span style="color:blue">/&gt;</span><o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="color:blue">&lt;</span><span style="color:fuchsia">h</span><span 
                         style="color:blue">:</span><span style="color:#404040">text</span>
                   <span style="color:red">id</span><span style="color:blue">=&quot;textarea&quot;</span>
                   <span style="color:red">Text</span><span style="color:blue">=&quot;</span></span><span style="font-size:9.5pt;
font-family:宋体;mso-ascii-font-family:&quot;Microsoft YaHei&quot;;mso-fareast-font-family:
宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:&quot;Microsoft YaHei&quot;;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;;color:blue;mso-font-kerning:0pt">多</span><span style="font-size:9.5pt;font-family:宋体;mso-ascii-font-family:&quot;Microsoft YaHei&quot;;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;color:blue;mso-font-kerning:
0pt">行文本框</span><span lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;;color:blue;mso-font-kerning:0pt">&quot;</span><span 
                         lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt"> <span style="color:red">istextarea</span><span 
                         style="color:blue">=&quot;true&quot;</span> <span style="color:red">maxchar</span><span 
                         style="color:blue">=&quot;100&quot;&gt;&lt;/</span><span style="color:fuchsia">h</span><span 
                         style="color:blue">:</span><span style="color:fuchsia">text</span><span 
                         style="color:blue">&gt;</span><o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="color:blue">&lt;</span><span style="color:maroon">div</span>
                   <span style="color:red">id</span><span style="color:blue">=&quot;msg&quot;&gt;</span>0/<span 
                         style="color:#404040">100</span><span style="color:blue">&lt;/</span><span 
                         style="color:maroon">div</span><span style="color:blue">&gt;<o:p></o:p></span></span></p>
             &lt;script type=&quot;text/javascript&quot;&gt;<br />
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" style="font-size:9.5pt;font-family:&quot;Microsoft YaHei&quot;;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                   _h.Page.<span style="color:#880000">OnLoadHandle</span> =
                   <span style="color:blue">function</span> () {<o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   </span><span style="color:
blue">var</span> <span style="color:#404040">textarea</span> = _g(<span style="color:maroon">&quot;#textarea&quot;</span>);<o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   </span><span style="color:
#404040">textarea</span>.<span style="color:#880000">SetHeight</span>(120);<o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   </span><span style="color:
#404040">textarea</span>.<span style="color:#880000">SetWidth</span>(470);<o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   </span><span style="color:
#404040">textarea</span>.<span style="color:#880000">KeyUpHandle</span> = <span style="color:blue">
                   function</span> (<span style="color:#404040">e</span>,
                   <span style="color:#404040">lenght</span>) {<o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   </span>_g(<span style="color:maroon">&quot;#msg&quot;</span>).<span style="color:#404040">html</span>(<span 
                         style="color:#404040">lenght</span> + <span style="color:maroon">&quot;/&quot;</span> 
                   + <span style="color:#404040">textarea</span>.maxchar);<o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   </span>};<o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   </span>};<o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   </span><span style="color:blue">function</span> <span style="color:#880000">
                   GetTextareaContent</span>() {<o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   </span><span style="color:blue">var</span> <span style="color:#404040">textarea</span> 
                   = _g(<span style="color:maroon">&quot;#textarea&quot;</span>);<o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   </span><span style="color:
#880000">alert</span>(<span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt"><span 
                         style="color:#404040">textarea</span></span>.<span style="color:#880000">GetText</span>());<o:p></o:p></span></p>
             <p align="left" class="MsoNormal">
                   <span lang="EN-US" 
                         style="font-size:9.5pt;font-family:
&quot;Microsoft YaHei&quot;;mso-bidi-font-family:&quot;Microsoft YaHei&quot;;mso-font-kerning:0pt">
                   <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   </span>}<o:p></o:p></span></p>
             &lt;/script&gt;</div>

</body>
</html>
